package great.project.common.http;

/**
 *
 */
public enum ResultEnum {
    /**
     *
     */
    SUCCESS(200 , "success") ,
    FAIL(503 , "fail"),
    ERROR(500 , "error")
    ;
    private final Integer code;

    private final String  msg;

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ResultEnum forIn(Integer code){
        for (ResultEnum value : ResultEnum.values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
